package me.zhengjie.modules.inspection.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.sql.Timestamp;
import java.io.Serializable;

/**
* @author xuyukun
* @date 2019-07-21
*/
@Entity
@Data
@Table(name="inspection_plan")
@DynamicUpdate
public class InspectionPlan implements Serializable {

	private static final long serialVersionUID = -4357908990107729702L;

	// ID
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    private Long id;

    // 计划名称
    @Column(name = "plan_name")
    private String planName;

    // 巡检对象id
    @Column(name = "obj_id")
    private Long objId;

    // 巡检对象
    @Column(name = "obj_name")
    private String objName;

    // 巡检工具id
    @Column(name = "tool_id")
    private Long toolId;

    // 巡检工具名称
    @Column(name = "tool_name")
    private String toolName;

    // 巡检模板id
    @Column(name = "template_id")
    private Long templateId;

    // 巡检模板名称
    @Column(name = "template_name")
    private String templateName;

    // 巡检计划说明
    @Column(name = "plan_desc")
    private String planDesc;

    // 巡检周期id
    @Column(name = "period_id")
    private Long periodId;

    // 巡检周期名称
    @Column(name = "period_name")
    private String periodName;

    // 巡检人id
    @Column(name = "inspector_id")
    private Long inspectorId;

    // 巡检人名称
    @Column(name = "inspector_name")
    private String inspectorName;

    // 巡检车辆类型id
    @Column(name = "veh_type_id")
    private Long vehTypeId;

    // 巡检车辆类型m名称
    @Column(name = "veh_type_name")
    private String vehTypeName;

    // 开始时间
    @Column(name = "start_time")
    private Timestamp startTime;

    // 结束时间
    @Column(name = "end_time")
    private Timestamp endTime;

    // 录入人
    @Column(name = "input_operator",nullable = false)
    private String inputOperator;

    // 录入时间
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",  timezone="GMT+8")
    @Column(name = "input_time",nullable = false)
    private Timestamp inputTime;

    //状态
    @Column(name = "state")
    private Integer state;

    //状态
    @Column(name = "notes")
    private String notes;
}